package me.luger.project.fof.service;

import me.luger.core.commom.util.LogUtil;
import me.luger.core.dao.nutz.service.BaseService;
import org.nutz.dao.Dao;
import me.luger.project.fof.entity.FofUser;
import org.springframework.stereotype.Repository;

@Repository
public class FofUserService extends BaseService<FofUser> {
    public FofUserService(Dao dao) {
        super(dao);
    }

    public boolean grantFof2User(Integer fofId,Integer userId){
        FofUser fofUser = new FofUser();
        fofUser.setFofId(fofId);
        fofUser.setUserId(userId);
        try{
            this.insert(fofUser);
            if(null != fofUser.getId()){
                return true;
            }
        }catch (Exception e){
            LogUtil.errorLog(e,"grantFof2User error");
        }
        return false;
    }
}
